{% include "../../header.html" %} {% include "../../navigation.html" %}

<div class="wrapper">
    <div class="container-fluid">

        <!-- Page-Title -->
            <div class="row">
                    <div class="col-sm-12">
                            <div class="page-title-box">
                                <div class="btn-group pull-right">
                                    <h4 class="page-title">Menus</h4>
                                </div>
                                <ol class="breadcrumb hide-phone p-0 m-0">
                                    <li class="breadcrumb-item">
                                        <a href="#">HuntCMS</a>
                                    </li>
                                    <li class="breadcrumb-item">
                                        <a href="#">Menus</a>
                                    </li>
                                    <li class="breadcrumb-item active">Edit Menu</li>
                                </ol>
                            </div>
                        </div>
            </div>
        <!-- end page title end breadcrumb -->

        <div class="row">
            <div class="col-12">
                <div class="card-box">
                    <h4 class="m-t-0 header-title">{{ breadTitle }}</h4>
                    <p class="text-muted m-b-30 font-14">
                        User can Edit admin menu.
                    </p>

                    <div class="row">
                        <div class="col-12">
                            <div class="p-20">
                                <form class="form-horizontal" role="form" action="{{ url('system.menu.add', '')}}" method="post">
                                    <div class="form-group row hide">
                                        <label class="col-2 col-form-label">Id</label>
                                        <div class="col-10">
                                            <input type="text" class="form-control" required id="id" name="id" placeholder="Some text value..." value="{{ menu.id }}">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_FIRST_LEVEL") }}</label>
                                        <div class="col-10">
                                            <select class="form-control" name="pid">
                                                <option value="0"></option>
                                                {% for firstLevelMenu in firstLevelMenus %}
                                                {% if firstLevelMenu.id ==  menu.pid %}
                                                <option value="{{firstLevelMenu.id}}" selected >{{firstLevelMenu.name}}</option> 
                                                {% else %}
                                                <option value="{{firstLevelMenu.id}}">{{firstLevelMenu.name}}</option> 
                                                {% endif %}                                                                                             
                                                {% endfor %}                                              
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_NAME") }}</label>
                                        <div class="col-10">
                                            <input type="text" class="form-control" required id="name" name="name" placeholder="Some text value..." value="{{ menu.name }}">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_MCA") }}</label>
                                        <div class="col-10">
                                            <input type="text" class="form-control" required id="mca" name="mca" placeholder="Some text value..." value="{{ menu.mca }}">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_LINKURL") }}</label>
                                        <div class="col-10">
                                            <input type="text" class="form-control" required id="linkUrl" name="linkUrl" placeholder="Some text value..." value="{{ menu.linkUrl }}">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_ICON") }}</label>
                                        <div class="col-10">
                                            <input type="text" class="form-control" id="iconClass" name="iconClass" placeholder="Some text value..." value="{{ menu.iconClass }}">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_SORT") }}</label>
                                        <div class="col-10">
                                            <input type="number" class="form-control" id="sort" name="sort" placeholder="Some text value..." value="{{ menu.sort }}">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_ISACTION") }}</label>
                                        <div class="col-10">
                                            <div class="custom-control custom-radio">
                                                <input type="radio" id="actionRadio1" name="actionRadio" class="custom-control-input" value="1"  {% if menu.isAction == 1 %} checked {% endif %}>
                                                <label class="custom-control-label" for="actionRadio1">{{ trans("COMMON_SYSTEM_YES") }}</label>
                                            </div>
                                            <div class="custom-control custom-radio">
                                                <input type="radio" id="actionRadio2" name="actionRadio" class="custom-control-input" value="0" {% if menu.isAction == 0 %} checked {% endif %}>
                                                <label class="custom-control-label" for="actionRadio2">{{ trans("COMMON_SYSTEM_NO") }}</label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-2 col-form-label">{{ trans("MENU_SYSTEM_STATUS") }}</label>
                                        <div class="col-10">
                                            <div class="custom-control custom-radio">
                                                <input type="radio" id="statusRadio1" name="statusRadio" class="custom-control-input" value="1" {% if menu.status == 1 %} checked {% endif %}>
                                                <label class="custom-control-label" for="statusRadio1">{{ trans("COMMON_SYSTEM_ENABLED") }}</label>
                                            </div>
                                            <div class="custom-control custom-radio">
                                                <input type="radio" id="statusRadio2" name="statusRadio" class="custom-control-input" value="0" {% if menu.status == 0 %} checked {% endif %}>
                                                <label class="custom-control-label" for="statusRadio2">{{ trans("COMMON_SYSTEM_DISABLED") }}</label>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group mb-0 justify-content-end row">
                                        <div class="col-md-10">
                                            <button type="submit"  class="btn btn-info waves-effect waves-light">Save</button>
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>

                    </div>
                    <!-- end row -->

                </div>
                <!-- end card-box -->
            </div>
            <!-- end col -->
        </div>
        <!-- end row -->

    </div>
    <!-- end container -->
</div>
<!-- end wrapper -->

{% include "../../footer.html" %}

<!-- Parsleyjs -->
<script type="text/javascript" src="/assets/vendor/parsleyjs/dist/parsley.min.js"></script>
<script>
    $(document).ready(function() {
        $('form').parsley();
    });
</script>